#ifndef __CRITICAL_SECTION_HEADER__
#define __CRITICAL_SECTION_HEADER__

#include <windows.h>

class CriticalSection
{
public:
	CriticalSection()
	{
		::InitializeCriticalSection(&cs);
	}
	~CriticalSection()
	{
		::DeleteCriticalSection(&cs);
	}
	void enter()
	{
		::EnterCriticalSection(&cs);
	}
	void leave()
	{
		::LeaveCriticalSection(&cs);
	}
private:
	CRITICAL_SECTION cs;
};

#endif